package com.meatball.iot.driver.smokealarm.enums

/**
 * TODO 烟感设备状态枚举
 *
 * @param code
 */
enum class DeviceStatusEnum(val code: Int) {
    NORMAL(1),
    ALARM(0),
    UNKNOWN(-1);

    companion object {
        fun fromCode(code: Int): DeviceStatusEnum {
            return entries.find { it.code == code } ?: UNKNOWN
        }
    }
}